#ifndef SOCKETTCP_H_
#define SOCKETTCP_H_

#include <pthread.h>
#include <string>
#include <vector>

class SocketTCP {
public:
	SocketTCP();
	virtual ~SocketTCP();

	virtual int connectServer(std::string ip, size_t port);
	virtual int disconnect();
	virtual int sendMessage(std::vector<char> const& msg);
	virtual int receiveMessage(std::vector<char> & msg);

private:
	int m_fdsocket;
	pthread_mutex_t m_mutex;

	int waitWriteEnd();
	int waitReadReady();

};

#endif /* SOCKETTCP_H_ */
